<!DOCTYPE html>
    <html>
    <head>
    	<meta charset="utf-8">
    	<title>用户管理</title>
    	<link rel="stylesheet" href="<?=adminassets?>assets/pear/component/pear/css/pear.css" />
    </head>
    <body class="pear-container">
    <?php if ($my == "list") : ?>
    	<div class="layui-card">
		<div class="layui-card-body">
			<form class="layui-form" action="">
				<div class="layui-form-item">
					<div class="layui-form-item layui-inline">
						<label class="layui-form-label">搜索</label>
						<div class="layui-input-inline">
							<select name="type">
							<option value="">请选择</option>
							<option value="pid">商户PID</option>
							<option value="qq">商户QQ</option>
							</select>
						</div>
					</div>
					<div class="layui-form-item layui-inline">
						<label class="layui-form-label">搜索内容</label>
						<div class="layui-input-inline">
							<input type="text" name="msg" placeholder="搜索内容" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item layui-inline">
						<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="user-query">
							<i class="layui-icon layui-icon-search"></i>
							查询
						</button>
						<button type="reset" class="pear-btn pear-btn-md">
							<i class="layui-icon layui-icon-refresh"></i>
							重置
						</button>
					</div>
				</div>
			</form>
		</div>
	</div>
    <div class="layui-card">
			<div class="layui-card-body">
				<table id="news" lay-filter="news"></table>
			</div>
		</div>

		<script type="text/html" id="toolbar">
			<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
				<i class="layui-icon layui-icon-add-1"></i>
				新增用户
			</button>
		</script>


		<script type="text/html" id="status">
			<input type="checkbox" name="status" value="{{d.pid}}" lay-skin="switch" lay-text="正常|封禁" lay-filter="status" {{# if(d.zt==1){ }} checked {{# } }}>
		</script>
		<script type="text/html" id="options">
			<button class="pear-btn pear-btn-warming pear-btn-sm" lay-event="password"><i class="layui-icon layui-icon-password"></i></button>
			<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></button>
			<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i></button>
		</script>
	<?php endif; ?>	
	<?php if ($my == "add") : ?>
	    <form class="layui-form" action="">
			<div class="mainBox">
				<div class="main-container">
					<div class="layui-form-item">
						<label class="layui-form-label">
							PID
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input layui-form-danger" disabled  value="系统随机给出" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							KEY
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input layui-form-danger" disabled value="系统随机给出" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
						登录账号
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="user"  value="" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
						登录密码
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="pass"  value="" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
						二级密码
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="pay_pass"  value="" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							qq
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="qq"  value="" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							邮箱
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="email"  value="" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							额度
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="money"  value="" placeholder="可空" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							二维码数量
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="qr_nums"  value=""  placeholder="可空 留空默认 1个额度"/>
						</div>
					</div>
				</div>
			</div>
			<div class="bottom">
				<div class="button-container">
					<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="addSave">
						<i class="layui-icon layui-icon-ok"></i>
						提交
					</button>
					<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
						<i class="layui-icon layui-icon-refresh"></i>
						重置
					</button>
				</div>
			</div>
		</form>
	<?php endif; ?>	
	<?php if ($my == "editPwd") : ?>
	<form class="layui-form" action="">
			<div class="mainBox">
				<div class="main-container">
				<input type="hidden" name="id" type="text" value="<?=$id?>" />
					<div class="layui-form-item">
						<label class="layui-form-label">
						登录密码
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="pass" value="" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
						二级密码
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="pay_pass" value="" />
						</div>
					</div>
				</div>
			</div>
			<div class="bottom">
				<div class="button-container">
					<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="editPwdSave">
						<i class="layui-icon layui-icon-ok"></i>
						提交
					</button>
					<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
						<i class="layui-icon layui-icon-refresh"></i>
						重置
					</button>
				</div>
			</div>
		</form>
	<?php endif; ?>	
	<?php if ($my == "edit") : ?>
	    <form class="layui-form" action="">
			<div class="mainBox">
				<div class="main-container">
				<input type="hidden" name="id" disabled value="<?=$id?>" />
					<div class="layui-form-item">
						<label class="layui-form-label">
							PID
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input layui-form-danger" readonly value="<?=$row['pid']?>" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							qq
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="qq"  value="<?=$row['qq']?>" placeholder="不可为空"/>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							额度
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="money"  value="<?=$row['money']?>" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							二维码数量
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="qr_nums"  value="<?=$row['qr_nums']?>" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
						支付宝免挂会员到期时间
						</label>
						<div class="layui-input-block">
							<input type="date" class="layui-input" name="alipay_free_vip_time"  value="<?=$row['alipay_free_vip_time']?>" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
						QQ钱包免挂会员到期时间
						</label>
						<div class="layui-input-block">
							<input type="date" class="layui-input" name="qqpay_free_vip_time" value="<?=$row['qqpay_free_vip_time']?>" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
						微信免挂会员到期时间
						</label>
						<div class="layui-input-block">
							<input type="date" class="layui-input" name="wxpay_free_vip_time" value="<?= $row['wxpay_free_vip_time'] ?>" />
						</div>
					</div>
				</div>
			</div>
			<div class="bottom">
				<div class="button-container">
					<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="editSave">
						<i class="layui-icon layui-icon-ok"></i>
						提交
					</button>
					<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
						<i class="layui-icon layui-icon-refresh"></i>
						重置
					</button>
				</div>
			</div>
		</form>
	<?php endif; ?>	
	<script src="<?=adminassets?>assets/pear/component/layui/layui.js"></script>
	<script src="<?=adminassets?>assets/pear/component/pear/pear.js"></script>
	<script type="text/javascript" src="<?=JQueryJS?>"></script>
	<script src="<?=adminassets?>assets/js/core_js/User.js?v=<?=time()?>"></script>